<template>
  <el-form-item label="礼品包名称" prop="name" :rules="rules" class="common-form-width">
    <el-input v-model="modelValue" placeholder="请输入礼品包名称" maxlength="15" show-word-limit @blur="modelValue = $event.target.value.trim()"></el-input>
  </el-form-item>
</template>

<script lang="ts" setup>
const props = withDefaults(defineProps<{
  modelValue: string
}>(), {
  modelValue: ''
})

const emits = defineEmits(['update:model-value'])
const modelValue = computed({
  set(newValue) {
    emits("update:model-value", newValue)
  },
  get() {
    return props.modelValue
  }
})

const rules = [{message: '请输入礼品包名称', required: true, trigger: 'blur'}]

</script>

<style scoped lang="scss">
@use "@/components/goodsCenter/styles/common.scss";
</style>
